import {
  HttpApi
} from '../../model/index.js'
const httpApi = new HttpApi

Page({
  data: {
    userinfo: null
  },
  onLoad: function() {
    let userinfo = wx.getStorageSync('userinfo')
    this.setData({
      userinfo: userinfo
    })
    this.getQiNiuToken()
  },
  getQiNiuToken: function() {
    if (!wx.getStorageSync('qiniuToken')) {
      httpApi.GetQiNiuToken().then(res => {
        wx.setStorageSync('qiniuToken', res.result)
      })
    }
  }
})